*************************************************************************
*																		*
*					Campaign Panel Book Chapter 5 - Cognitive Involvement	*
*																		*
*************************************************************************	


use "${data}\ZA5305_en_v5-0-0.dta", clear

*-----------------------------------
* Political Interest
*-------------------------------------

fre kp2_010

gen polintsplit = -1 if inlist(kp2_010, 4, 5)
replace polintsplit = 0 if 	kp2_010==3
replace polintsplit = 1 if inlist(kp2_010, 1, 2)

*Generate political interest variable, ranging from 0 to 1

gen polint=polintsplit
recode polint (0=0.5) (-1=0)
tab polint


tab kp2_010 polintsplit, m	

******************************************************************************
**																			**
**		Party Identification Variable										**
**																			**
******************************************************************************

fre kp1_2090
recode kp1_2090 (2/3=1 "CDU/CSU") (4=4 "SPD") ///
	(5=5 "FDP") (6=6 "Greens") (7=7 "The Left") (801=801 "andere Partei") ///
	(997=808 "no party") (999=.), gen(pidfull1)

tab pidfull1 kp1_2090, m


recode kp3_2090 (2/3=1 "CDU/CSU") (4=4 "SPD") ///
	(5=5 "FDP") (6=6 "Greens") (7=7 "The Left") (801=801 "andere Partei") ///
	(997=808 "no party") (999=.), gen(pidfull3)


* Dummy: Party Identification yes/no
gen nopid1 = 0
replace nopid1 = 1 if pidfull1==808
replace nopid1 = . if pidfull1==.

gen nopid3 = 0
replace nopid3 = 1 if pidfull3==808
replace nopid3 = . if pidfull3==.

gen nopid = nopid1
replace nopid = nopid3 if w1==0

tab kp1_2090 nopid if w1==1, m
tab kp3_2090 nopid if w1==0, m


*--------------------------
* Save
*--------------------------

keep lfdn polintsplit nopid


save "${path}\Reproducible Do-Files\Chapter 5\Data\koginvolv09.dta", replace
